package demo1210.am;

/**
 * 正方形类
 */
public class Square extends Shape {
//    边长
    private int line;

    public Square(int line) {
        this.line = line;
    }

    public Square() {
    }

    public int getLine() {
        return line;
    }

    public void setLine(int line) {
        this.line = line;
    }

    @Override
    public double area() {
        return line*line;
    }

    @Override
    public double length() {
        return 4*line;
    }
}
